#-*- coding:utf-8 -*-
from os import path
import logging

DEBUG = True
TEMPLATE_DEBUG = DEBUG

#DEBUG = False
#TEMPLATE_DEBUG = False

DATABASE_ENGINE = 'sqlite3' 
DATABASE_NAME = '/home/peigen/workspace/python_projects/yaya-foosball/peigen-blog.db'
DATABASE_USER = 'root'
DATABASE_PASSWORD = ''
DATABASE_HOST = 'localhost'
DATABASE_PORT = ''

TIME_ZONE = 'Asia/Shanghai'
LANGUAGE_CODE = 'zh-cn'
SITE_ID = 1

USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = path.join(path.dirname(__file__),'media')
ALLOW_FILE_TYPES = ('.jpg','.gif','.png','.css','.ico')
# URL that handles the media served from MEDIA_URL.
MEDIA_URL = '/media'
# the theme name 'default, techicon, beijing2008'
THEME_NAME = 'techicon'
#THEME_NAME = 'beijing2008'
#THEME_NAME = 'default'

STATIC_PATH = './media'

ADMIN_MEDIA_PREFIX = '/admin_media/'

#Send Email settings
EMAIL_HOST = 'smtp.sohu.com'
EMAIL_HOST_PASSWORD = ''
EMAIL_HOST_USER = ''

SECRET_KEY = 'zb2&a4g41snkt&*c92s=djl+*fcp((i85w(k&&)#$5j!+zz!!*'
#setting session expire after half a hour.
#SESSION_COOKIE_AGE =  60 * 30

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
    path.join(path.dirname(__file__),'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'blog',
    'todo',
    'filemanager',
    'wap',    
    'tests',
    'tinymce',
    'reader',
)
VERSION = (1, 15, 'beta')


#FEED CONF START
FEED_BLOG_URL_PREFIX = "http://peigen.info/"  #change to your site url
FEED_POST_AUTHOR_NAME = "Peigen"
FEED_COPYRIGHT =  "Pylogs by Sky"
FEED_GLOBAL_TITLE = "Peigen废话"
FEED_GLOBAL_DESCRIPTION = "Peigen废话"
#FEED CONF END
FORCE_SCRIPT_NAME = ""


FILEBROWSER_USE_IMAGE_GENERATOR = False
FILEBROWSER_URL_WWW = '/home/peigen/temp/backup/uploads/'
FILEBROWSER_MAX_UPLOAD_SIZE=1000000
FILEBROWSER_EXTENSIONS ={
    'Folder': [''],
    'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'],
    'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
    'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'],
    'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p'],
    'Code': ['.html','.py','.js','.css']
}

TINYMCE_DEFAULT_CONFIG = {
    'theme':"advanced",
    'relative_urls':False,
    'theme_advanced_toolbar_location': "top",
    'theme_advanced_buttons1':"formatselect,styleselect,blockquote,bold,italic,bullist,numlist,undo,redo,link,unlink,image,code,fullscreen,search",
    'theme_advanced_buttons2':"",
    'theme_advanced_buttons3':"",
    'theme_advanced_blockformats': "p,h2,h4,h6,div,blockquote,span",
    'theme_advanced_styles': "[all] clearfix=clearfloat;[div]red_text=red; [div] green_text=green; [img] img_left=fl p_all-4;[img] img_right=fr p_all-4;[img] img_zoom=remooz;",
    'plugins':"advimage,fullscreen,paste,searchreplace",
    'advimage_styles': "Text=img_left; Text=img_right; Block=img_block",
    'advimage_update_dimensions_onchange': "true",
    'valid_elements' : "" +
    "-p," + 
    "a[href|target=_blank|class]," +
    "-strong/-b," +
    "-em/-i," +
    "-u," + 
    "-ol," + 
    "-ul," + 
    "-li," + 
    "br," + 
    "img[class|src|alt=|width|height]," + 
    "-h2,-h3,-h4," + 
    "-pre," +
    "-span[class]," +
    "-code," + 
    "-div,"+
    "-blockquote,",
}

TINYMCE_DEFAULT_CONFIG = {
'plugins': "table,spellchecker,paste,searchreplace",
'theme': "advanced",

'theme_advanced_toolbar_location' : "top",
'theme_advanced_toolbar_align' : "left",

'width': 600,
'height': 400,
}

logging.basicConfig(  
    level = logging.DEBUG,   
      
    format = '%(asctime)s %(levelname)s %(module)s.%(funcName)s Line:%(lineno)d %(message)s',  
    filename = '/tmp/common.log',  
)
